﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Sisocana.Core.Models.SiteModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Edit the site
</asp:Content>


<asp:Content ID="Content4" ContentPlaceHolderID="HeaderContent" runat="server">
    	
    <script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
    <link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />

    <script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/multiplemarkersmap.js") %>" type="text/javascript"></script>


    
<%
  /*creo algo para serializar el contenido de las variables del back*/
  var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
%>


    <script language="javascript" type="text/javascript">
        $(document).ready(function() {


                                      
                var Url = location.href;
                Url = Url.replace(/.*\?(.*?)/,"$1");
                Variables = Url.split ("&");
                for (i = 0; i < Variables.length; i++) {
                     Separ = Variables[i].split("=");
                     eval ('var '+Separ[0]+'="'+Separ[1]+'"');                 
                }
                 $("#tabs").tabs();
                $("#tabs").tabs("select" , tab);                
                getContentTab (tab,idsitio);
               
                $("p a, input:submit,input:file ").button();

        });

        function getContentTab(index,siteid,selector) {
            
            var url='<%= Url.Content("~/Site/getAjaxTab") %>?id=' + index + '&idSitio=' + siteid ;            
            var targetDiv = "#tabs-" + index;
            var ajaxLoading = "<img id='ajax-loader' src='<%= Url.Content("~/Content/Images") %>/loading.gif' align='left' height='20' width='20'>";
                       
            $(targetDiv).html("<p>" + ajaxLoading + "    Loading...</p>"); 
           
            $.get(url,null, function(result) {                
                $(targetDiv).html(result);
            });
        }

    </script>

   
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">


<h2>Edit the Site</h2>

    <div id="tabs">
	    <ul>
		    <li><a href="#tabs-1" onclick="getContentTab(1,<%=Model.id %>);">Basic</a></li>
		    <li><a href="#tabs-2" onclick="getContentTab(2,<%=Model.id %>);">Appearance</a></li>
		    <li><a href="#tabs-3" onclick="getContentTab(3,<%=Model.id %>);">Social Network</a></li>
            <li><a href="#tabs-4" onclick="getContentTab(4,<%=Model.id %>);">Videos</a></li>
            <li><a href="#tabs-5" onclick="getContentTab(5,<%=Model.id %>);">Images</a></li>
            <li><a href="#tabs-6" onclick="getContentTab(6,<%=Model.id %>);">Upload Img</a></li>
            <li><a href="#tabs-7" onclick="getContentTab(7,<%=Model.id %>);">News</a></li>
            <li><a href="#tabs-8" onclick="getContentTab(8,<%=Model.id %>);">ONG's</a></li>
            <li><a href="#tabs-9" onclick="getContentTab(9,<%=Model.id %>);">Integration</a></li>
            <li><a href="#tabs-10"onclick="getContentTab(10,<%=Model.id %>)";>Status</a></li>            
	    </ul>
	    <div id="tabs-1">            	    
	    </div>
	    <div id="tabs-2">           	    
	    </div>
	    <div id="tabs-3">	       	    
	    </div>
        <div id="tabs-4">	       	    
	    </div>
        <div id="tabs-5">	       	    
	    </div>
        <div id="tabs-6">	       	    
	    </div>
        <div id="tabs-7">	       	    
	    </div>
        <div id="tabs-8">	       	    
	    </div>
        <div id="tabs-9">	       	    
	    </div>
        <div id="tabs-10">	       	    
	    </div>
    </div>    

   
</asp:Content>
